import request from '@/utils/request';
import Cookies from 'js-cookie';
// 查询线索列表
export function getClueList(data) {
    return request({
        url: '/tienchin/clue/list',
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        },
       params: data
    });
}

export function getClueChannel(){
    return request({
        url: '/tienchin/clue/channels',
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function addClue(data){
    return request({
        url: '/tienchin/clue',
        method: 'post',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        },
        data
    });
}

export function getClueInfo(clueId){
    return request({
        url: '/tienchin/clue/summary/' + clueId,
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function editClue(data){
    return request({
        url: '/tienchin/clue',
        method: 'put',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        },
        data
    });
}

export function deleteClue(clueIds){
    return request({
        url: '/tienchin/clue/' + clueIds,
        method: 'delete',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function getClueDetail(clueId){
    return request({
        url: '/tienchin/clue/' + clueId,
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}
export function getActivityDetail(channelId){
    return request({
        url: '/tienchin/clue/activity/' + channelId,
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function getClueFollow(data){
    return request({
        url: '/tienchin/clue/follow',
        method: 'post',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        },
        data
    });
}

export function getClueRecord(clueId){
    return request({
        url: '/tienchin/follow/record/clue/' + clueId,
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function getClueVoid(data){
    return request({
        url: '/tienchin/clue/invalid',
        method: 'post',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        },
        data
    });
}

export function getClueChannelStatus(){
    return request({
        url: 'http://47.104.167.34:9100/prod-api/system/dict/data/type/clue_status',
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}
export function getClueVoidStatus(){
    return request({
        url: 'http://47.104.167.34:9100/prod-api/system/dict/data/type/clue_invalidate',
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function getShop(clueId){
    return request({
        url: '/tienchin/clue/to_business/' + clueId,
        method: 'post',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function getClueDepartment(){
    return request({
        url: '/system/dept/treeselect',
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function getClueDepartmentUser(deptId){
    return request({
        url: '/tienchin/clue/users/' + deptId,
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function getAssign(data){
    return request({
        url: '/tienchin/assignment',
        method: 'post',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        },
        data
    });
}

export function getLevel(){
    return request({
        url: 'http://47.104.167.34:9100/prod-api/system/dict/data/type/clue_level',
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}

export function getSex(){
    return request({
        url: 'http://47.104.167.34:9100/prod-api/system/dict/data/type/sys_user_sex',
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}
export function getSubject(){
    return request({
        url: 'http://47.104.167.34:9100/prod-api/system/dict/data/type/course_type',
        method: 'get',
        headers:{
            'Authorization': Cookies.get('Admin-Token')
        }
    });
}